﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RaciosCustoDiaLista.aspx.cs" Inherits="welwitschia.Racios.RaciosCustoDiaLista" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" language="javascript">
        $(function () {
            $("#<%=txtData.ClientID%>").datepicker();
        });

        $(document).ready(function () {
            $("#MainContent_lvRacios_chkAll").click(function () {
                var checked_status = this.checked;
                $("td >.selectAllItems >input:checkbox").each(function () {
                    this.checked = checked_status;
                });
            });

        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="header" class="info">
            <h2>
                Rácios Custos Dia</h2>
            <div>
            </div>
        </div>
  
    <p>
        <asp:Label ID="lblUnidade" Text ="Unidade" runat="server"></asp:Label>
        <asp:DropDownList ID="ddlUnidadeContrato" runat="server"></asp:DropDownList>
        <asp:Label ID="lblData" Text="Data:" runat="server"></asp:Label>
        <asp:TextBox ID="txtData" runat="server"></asp:TextBox>
        <asp:Button ID="btnPesquisar" runat="server" Text="Pesqusiar" 
            onclick="btnPesquisar_Click" />
    </p>
        
    <asp:ListView runat="server" ID="lvRacios"  
            onitemdeleting="lvRacios_ItemDeleting" 
            onitemediting="lvRacios_ItemEditing" 
            onitemcommand="lvRacios_ItemCommand">
        <LayoutTemplate>
             <table runat="server" class="grd2" id="table2">
                <thead>
                     <tr class="ghdr2">
                     <td>
                       <asp:CheckBox ID="chkAll" runat="server"/>
                     </td>
                     <td>
                       <asp:Label ID="Label2" runat="server">Cliente</asp:Label>
                     </td>
                     <td>
                        <asp:Label ID="Label3" runat="server">Unidade</asp:Label>
                     </td>
                     <td>
                        <asp:Label ID="Label5" runat="server">Total Custos Efectivos</asp:Label>
                     </td>
                     <td>
                        <asp:Label ID="Label4" runat="server">Total Custos Previstos</asp:Label>
                     </td>
                     <td>
                        <asp:Label ID="Label6" runat="server">Total Vendas Efectivas</asp:Label>
                     </td>
                     <td>
                        <asp:Label ID="Label1" runat="server">Total Vendas Previstas</asp:Label>
                     </td>
                     <td>
                        <asp:Label ID="Label7" runat="server">Rácio Efectivo</asp:Label>
                     </td>
                     <td>
                        <asp:Label ID="Label8" runat="server">Rácio Previsto</asp:Label>
                     </td>
                     <td>
                        &nbsp;
                     </td>
                     </tr>
                </thead>
                <tr runat="server" id="itemPlaceholder">
                </tr>
            </table>
            <asp:DataPager runat="server" ID="DataPager" PageSize="20">
              <Fields>
                <asp:NumericPagerField
                  ButtonCount="5"
                  PreviousPageText="<--"
                  NextPageText="-->" />
              </Fields>
            </asp:DataPager>
        </LayoutTemplate>
        <ItemTemplate>
            <tr id="Tr1" class='grd2<%#Container.DataItemIndex % 2 %>'>
                <td id="Td10" runat="server">
                    <asp:CheckBox ID="chkBox" CssClass="selectAllItems" runat="server" />
                </td>
                <td id="Td1" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="lblUnidade" runat="server" Text='<%#Eval("Nome") %>' />
                </td>
                 <td id="Td3" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="Label9" runat="server" Text='<%#Eval("Designacao") %>' />
                </td>
                 <td id="Td6" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="Label12" runat="server" Text='<%#Eval("TotalCustosEfectivo") %>' />
                </td>
                 <td id="Td7" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="Label13" runat="server" Text='<%#Eval("TotalCustosPrevisto") %>' />
                </td>
                 <td id="Td8" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="Label14" runat="server" Text='<%#Eval("TotalVendasEfectivo") %>' />
                </td>
                 <td id="Td9" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="Label15" runat="server" Text='<%#Eval("TotalVendasPrevisto") %>' />
                </td>
                  <td id="Td4" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="Label10" runat="server" Text='<%#Eval("RacioMprimasEfectivo") %>' />
                </td>
                 <td id="Td5" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="Label11" runat="server" Text='<%#Eval("RacioMprimasPrevisto") %>' />
                </td>
                 <td id="Td2" runat="server">
                        <%-- Data-bound content. --%>
                        <asp:LinkButton ID="DeleteButton" 
                            CommandName="Detail" CommandArgument='<%# Eval("IdCliente")%>' runat="server"
                            Text="Detalhe"></asp:LinkButton>
                    </td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
    <div class="pageCommandArea">
        <asp:Button id="btnImprime" runat="server" OnClick="btnImprime_Click" Text="Imprimir"/></div>
</asp:Content>
